package com.xnyzc.lhy.common.penum.cms.amount;

/**
 * @Description 分配类型(0f分配/1回收/2充值)
 * @Author zhuyubin
 * @Date 2019-08-31 11:05
 **/
public enum EDistributionType {

    assign(0, "分配"),
    recover(1, "回收"),
    recharge(2, "充值");

    private Integer value;
    private String desc;

    EDistributionType(Integer value, String desc){
        this.value = value;
        this.desc = desc;
    }

    public static EDistributionType findByValue(Integer value) {
        EDistributionType eDistributionType;
        switch (value) {
            case 0:
                eDistributionType = EDistributionType.assign;
                break;
            case 1:
                eDistributionType = EDistributionType.recover;
                break;
            case 2:
                eDistributionType = EDistributionType.recharge;
                break;
            default:
                throw new IllegalArgumentException("未设置");
        }
        return eDistributionType;
    }

    public Integer getValue() {
        return this.value;
    }

    public String getDesc() {
        return this.desc;
    }
}
